import { getProfileAPI } from "@/api/system"
import { routes } from "@/router"
export default {
    namespaced: true,
    state: {
        profile: {},
        menuRouterList: {},
    },
    mutations: {
        setProfile(state, newstate) {
            state.profile = newstate
        },
        setmenuRouterList(state, asyncRoute) {
            state.menuRouterList = [...routes, ...asyncRoute]
        }
    },
    getters: {

    },
    actions: {
        async getProfile(store) {
            const res = await getProfileAPI()
                // console.log(res)
            store.commit('setProfile', res.data.permissions)
            return res.data.permissions
        }
    }
}